import _ from 'lodash'
import {FlowPortModel} from "../../flow/FlowPortModel"
import {BaseNodeModel} from "../base/BaseNodeModel";

export class StartNodeModel extends BaseNodeModel {
  constructor (name="Start") {
    super('start')
    this.name = name
    this.addPort(new FlowPortModel())
  }

  deSerialize (object) {
    super.deSerialize(object)
    this.name = object.name
    this.color = object.color
  }

  serialize () {
    return _.merge(super.serialize(), {
      name: this.name,
      color: this.color,
    })
  }
}
